package com.billing.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.billing.aop.Auditable;
import com.billing.persistance.dao.IGenericDAO;
import com.billing.persistance.entities.BillOwner;

@Service
public class BillOwnerServiceImpl implements IBillOwnerService {

	@Autowired
	@Qualifier(value = "billingOwnerDAO")
	private IGenericDAO<BillOwner, Long> ownerDAO;
	
	@Auditable
	@Transactional
	public void createBillOwner(BillOwner owner) {
		ownerDAO.create(owner);
	}

	@Auditable
	@Transactional
	public void deleteEntryCopcept(BillOwner owner) {
		ownerDAO.delete(owner);
	}

	@Auditable
	@Transactional
	public void updateEntryConcept(BillOwner owner) {
		ownerDAO.update(owner);
	}
	
	@Transactional(readOnly = true)
	public List<BillOwner> getAllOwners() {
		return ownerDAO.getList("");
	}

}
